import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router'
import login from '../views/login.vue'
import register from '../views/register.vue'

const routes = [
    {
        path: '/',
        name: '',
        component: () => import('../views/index.vue'),
        // hidden: true,
        children: [{
            path: '/',
            component: () => import('../views/HOME/Home.vue'),
            meta: {
                // isLogin: false,
                index: '/index',
            }
        },]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/login.vue'),
        hidden: true,
        meta: {
            requireAuth: false,
            index: '/login',
        }
    },
    {
        path: '/register',
        name: 'register',
        component: () => import('../views/register.vue'),
        hidden: true,
        meta: {
            requireAuth: false,
            index: '/register',
        }
    },

    {
        path: '/index',
        name: '首页',
        component: () => import('../views/index.vue'),
        // iconCls: 'el-icon-tickets',
        meta: {
            requireAuth: false,
            index: '/index',
        },
    },
    {
        path: '/home',
        name: 'home',
        component: () => import('@/views/HOME/Home.vue'),
        hidden: true,
        meta: {
            requireAuth: false,
            index: '/home',
        },
        redirect: "/"

    },

]
const router = createRouter({
    //history模式
    // history: createWebHistory(process.env.BASE_URL),
    //hash模式
    history: createWebHashHistory(),
    routes: routes
})


export default router
